package me.jtx.poplar.user;

import java.util.Arrays;
import java.util.List;

import javax.annotation.PostConstruct;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.ImportResource;

/**
 * Loaded from the property files
 *
 * @author: Tong Huazhong(jsyzthz@gmail.com)
 * @copyright: &copy; 2016, Tong Huazhong
 */
@ImportResource("classpath:config/spring/applicationContext-properties.xml")
public class Props {
    public @Value("#{fProps['poplar.host']}") String fHost;
    public @Value("#{fProps['poplar.api.path']}") String fApiPath;
    public @Value("#{fProps['poplar.web.path']}") String fWebPath;
    public @Value("#{fProps['poplar.user.country']}") String fUserCountry;


    public List<String> webAuthRoutes;
    public List<String> apiAuthRoutes;
    
    @PostConstruct
    public void init() {
        webAuthRoutes = Arrays.asList(
                fWebPath + Route.HOME
        );

        apiAuthRoutes = Arrays.asList(
                fApiPath + Route.Api.userController + Route.Api.uRegister,
                fApiPath + Route.Api.userController + Route.Api.uLogin
        );
    }
}
